package org.zeurox.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;
import org.zeurox.dao.IUserDAO;
import org.zeurox.model.Login;

@Transactional(readOnly = true)
public class UserService implements IUserService {
	
	// UserDAO is injected...
	IUserDAO userDAO; 

	@Transactional(readOnly = false)
	@Override
	public void addUser(Login user) {
		getUserDAO().addUser(user);
	}

	@Override
	public void updateUser(Login user) {
		getUserDAO().updateUser(user);
	}

	@Override
	public void deleteUser(Login user) {
		getUserDAO().deleteUser(user);
	}

	@Override
	public Login getUserById(int id) {
		return getUserDAO().getUserById(id);
	}

	@Override
	public List<Login> getUsers() {
		return getUserDAO().getUsers();
	}

	public IUserDAO getUserDAO() {
		return userDAO;
	}

	public void setUserDAO(IUserDAO userDAO) {
		this.userDAO = userDAO;
	}
	
	

}
